package com.myrice.jms;

import com.myrice.core.Connection;
import com.myrice.core.Connector;
import com.myrice.core.ServerContext;
import com.myrice.core.Session;

public interface MsgServerHandler extends ServerContext {
	/** 创建新的Session */
	MsgSession createSession(Connection conn, Object sid);

	/** 获取指定Session */
	MsgSession getSession(String sessionId);

	/** 注销服务过滤器 */
	boolean removeFilter(MsgFilter filter);

	/** 添加过滤器到第一个 */
	void addFirstFilter(MsgFilter filter);

	/** 注册服务过滤器 */
	boolean addLastFilter(MsgFilter filter);

	public Connector<Connection, Session> getConnector();

	MessageFactory getMessageFactory();

	void setMessageFactory(MessageFactory factory);

	boolean addListener(Listener listener);

	boolean removeListener(Listener listener);

}
